package com.index.dao;

import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Component;
import org.mybatis.spring.support.SqlSessionDaoSupport;

import com.commonboard.domain.CommonBoardCommand;
import com.eventboard.domain.EventBoardCommand;
import com.member.domain.MemberCommand;
import com.successboard.domain.SuccessBoardCommand;

@Component
public class IndexDaoImpl extends SqlSessionDaoSupport implements IndexDao{

	@Override
	public List<CommonBoardCommand> commonBoardList(Map<String, Object> map) {
		List<CommonBoardCommand> commonList = getSqlSession().selectList("CommonBoard.maincommonList",map);
		return commonList;
	}

	@Override
	public int getCommonRowCount(Map<String, Object> map) {
		return getSqlSession().selectOne("CommonBoard.selectCount",map);
	}

	/*@Override
	public List<EventBoardCommand> eventBoardList(Map<String, Object> map) {
		List<EventBoardCommand> list = getSqlSession().selectList("EventBoard.maineventList",map);
		return list;
	}

	@Override
	public int getEventRowCount(Map<String, Object> map) {
		return getSqlSession().selectOne("EventBoard.selectCount",map);
	}*/

	@Override
	public List<SuccessBoardCommand> successBoardList(Map<String, Object> map) {
		List<SuccessBoardCommand> list = getSqlSession().selectList("SuccessBoard.mainsuccessList",map);
		return list;
	}

	@Override
	public int getSuccessRowCount(Map<String, Object> map) {
		return getSqlSession().selectOne("SuccessBoard.selectCount",map);	
	}

	@Override
	public List<MemberCommand> memberManList(Map<String, Object> map) {
		List<MemberCommand> list = getSqlSession().selectList("Member.memberManList1",map);
		return list;
	}

	@Override
	public int getMemberManCount(Map<String, Object> map) {
		return getSqlSession().selectOne("Member.selectManCount",map);
	}

	@Override
	public List<MemberCommand> memberWomanList(Map<String, Object> map) {
		List<MemberCommand> list = getSqlSession().selectList("Member.memberWomanList1",map);
		return list;
	}

	@Override
	public int getMemberWomanCount(Map<String, Object> map) {
		return getSqlSession().selectOne("Member.selectWomanCount",map);
	}
	
}
